<?php /* Smarty version 2.6.18, created on 2009-11-19 00:18:08
         compiled from exporterShipmentTrackingReportSub.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'number_format', 'exporterShipmentTrackingReportSub.tpl', 41, false),)), $this); ?>
<div>
	<table border="0" style="border-collapse: collapse; width: 100%;">
		<tr>
			<td style="width: 100px; background-color: #ccffff; padding-bottom: 5px; padding-top: 5px; text-align: center;" nowrap>
			<?php $this->assign('count', 0); ?>
			<?php $this->assign('index', 0); ?>
			<?php $_from = $this->_tpl_vars['exporters']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['exporter']):
?>
				<?php $this->assign('count', ($this->_tpl_vars['count']+1)); ?>	
				<?php $this->assign('index', ($this->_tpl_vars['count']-1)); ?>
				<a href="javascript:void(0);" onclick="doajaxAction('/account/exporterTrackingShipmentReport/reload/1/page/<?php echo $this->_tpl_vars['index']; ?>
',1,'result',document.getElementById('filterForm'))"><?php if ($this->_tpl_vars['exporter']['name'] == $this->_tpl_vars['curr_exporter'][0]['name']): ?><em><b><?php echo $this->_tpl_vars['count']; ?>
</b></em><?php else: ?><?php echo $this->_tpl_vars['count']; ?>
<?php endif; ?></a>&nbsp;
			<?php endforeach; endif; unset($_from); ?>
			</td>
		</tr>
	</table>
<br><br>
	<table border="1" style="border-collapse: collapse;">
	    <tr>
            <td style="background-color: #ff00ff; width: 200px; text-align: center;"><b>EXPORTER</b></td>
            <td style="background-color: #ff00ff; width: 200px; text-align: center;"><b>Items</b></td>
            <?php $this->assign('count_date', 0); ?>
            <?php $_from = $this->_tpl_vars['shipDates']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['shipDate']):
?>
				<?php $this->assign('count_date', ($this->_tpl_vars['count_date']+1)); ?>
				<td style="background-color: #ff00ff; width: 100px; text-align: center; "><b><?php echo $this->_tpl_vars['count_date']; ?>
</b></td>
            <?php endforeach; endif; unset($_from); ?>
            <td style="background-color: #ff00ff; width: 100px; text-align: center;"><b>TOTAL</b></td>
        </tr>
        <tr>
			<td nowrap><b><?php echo $this->_tpl_vars['curr_exporter'][0]['name']; ?>
</b></td>
			<td>Shipment Date</td>
			<?php $_from = $this->_tpl_vars['shipments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['shipment']):
?>
				<td align="right"><?php echo $this->_tpl_vars['shipment']['date_shipment']; ?>
</td>
			<?php endforeach; endif; unset($_from); ?>
			<td></td>
        </tr>
        <tr>
			<td nowrap><i><?php echo $this->_tpl_vars['curr_exporter'][0]['province']; ?>
,&nbsp;<?php echo $this->_tpl_vars['curr_exporter'][0]['country_code']; ?>
</i></td>
			<td>Number Delivered</td>
			<?php $this->assign('total_delivered', 0); ?>
			<?php $_from = $this->_tpl_vars['shipments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['shipment']):
?>
				<?php $this->assign('total_delivered', ($this->_tpl_vars['total_delivered']+$this->_tpl_vars['shipment']['sum_shipment'])); ?>
				<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['shipment']['sum_shipment'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '0%d') : number_format($_tmp, '0%d')); ?>
</td>
			<?php endforeach; endif; unset($_from); ?>
			<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['total_delivered'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '0%d') : number_format($_tmp, '0%d')); ?>
</td>
        </tr>
        <tr>
			<td></td>
			<td>DOA</td>
			<?php $this->assign('total_doa', 0); ?>
			<?php $_from = $this->_tpl_vars['shipments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['shipment']):
?>
				<?php $this->assign('total_doa', ($this->_tpl_vars['total_doa']+$this->_tpl_vars['shipment']['sum_doa'])); ?>
				<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['shipment']['sum_doa'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '0%d') : number_format($_tmp, '0%d')); ?>
</td>
			<?php endforeach; endif; unset($_from); ?>
			<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['total_doa'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '0%d') : number_format($_tmp, '0%d')); ?>
</td>
        </tr>
        <tr>
			<td></td>
			<td>Reject</td>
			<?php $this->assign('total_reject', 0); ?>
			<?php $_from = $this->_tpl_vars['shipments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['shipment']):
?>
				<?php $this->assign('total_reject', ($this->_tpl_vars['total_reject']+$this->_tpl_vars['shipment']['sum_reject'])); ?>
				<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['shipment']['sum_reject'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '0%d') : number_format($_tmp, '0%d')); ?>
</td>
			<?php endforeach; endif; unset($_from); ?>
			<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['total_reject'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '0%d') : number_format($_tmp, '0%d')); ?>
</td>
        </tr>
        <tr>
			<td></td>
			<td>Revenue</td>
			<?php $this->assign('total_revenue', 0); ?>
			<?php $_from = $this->_tpl_vars['shipments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['shipment']):
?>
				<?php $this->assign('total_revenue', ($this->_tpl_vars['total_revenue']+$this->_tpl_vars['shipment']['sum_total_amount'])); ?>
				<td align="right" nowrap><?php echo $this->_tpl_vars['shipment']['currency_mark']; ?>
&nbsp;<?php echo ((is_array($_tmp=$this->_tpl_vars['shipment']['sum_total_amount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
</td>
			<?php endforeach; endif; unset($_from); ?>
			<td align="right" nowrap><?php echo $this->_tpl_vars['shipment']['currency_mark']; ?>
&nbsp;<?php echo ((is_array($_tmp=$this->_tpl_vars['total_revenue'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
</td>
        </tr>
        
        <?php $this->assign('impcount', 0); ?>
        <?php $_from = $this->_tpl_vars['importer_count']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['imp']):
?>
			<?php $this->assign('impcount', ($this->_tpl_vars['impcount']+1)); ?>
		<tr>
			<td></td>
			<td nowrap>Importers&nbsp;<?php echo $this->_tpl_vars['impcount']; ?>
</td>
			<?php $_from = $this->_tpl_vars['shipments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['shipment']):
?>
				<?php $this->assign('impname', ''); ?>
				<?php $_from = $this->_tpl_vars['importers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['importer']):
?>
					<?php if ($this->_tpl_vars['shipment']['date_shipment'] == $this->_tpl_vars['importer']['date_shipment'] && $this->_tpl_vars['imp']['name'] == $this->_tpl_vars['importer']['name']): ?>
						<?php $this->assign('impname', $this->_tpl_vars['importer']['name']); ?>
					<?php endif; ?>
				<?php endforeach; endif; unset($_from); ?>
				<td><?php echo $this->_tpl_vars['impname']; ?>
</td>
			<?php endforeach; endif; unset($_from); ?>
		</tr>
        <?php endforeach; endif; unset($_from); ?>

	</table>
</div>
<br>
<div id="print">
	<table>
		<tr>
			<td><input type="button" value="Save to Excel"/></td>
			<td><input type="button" value="Print"/></td>
		</tr>
	</table>
</div>